Florian Müllner [Tue, 13 Jun 2023 00:13:01 +0000 (02:13 +0200)]
main: Load perf scripts as modules
The perf scripts that can be used to script the gnome-shell UI
for testing are sufficiently separate from the rest of the code
base to allow porting them to ESM modules before the rest of
the code base.
Florian Müllner [Mon, 12 Jun 2023 21:28:54 +0000 (23:28 +0200)]
extensionSystem: Remove "disable" file on shutdown
The file indicates to the systemd shutdown scripts that extensions
should be disabled, so that extensions that crash the shell on
startup cannot lock out the user indefinitely.
For that purpose, we create the file before initializing extensions,
and remove it after 60 seconds. That generally works, because it's
highly unlikely that a session genuinely ends within the first minute.
It's possible though (for example during developments or when running
tests), so also remove the file when shutting down cleanly before
the timeout.
Florian Müllner [Thu, 1 Jun 2023 22:47:22 +0000 (00:47 +0200)]
extensionSystem: Load extensions as modules
Continue the move to ESM by loading modules dynamically with
the standard import() expression, rather than by installing a
custom (legacy) importer.
This is a breaking change that affects all extensions, as they
now need to explicitly export the expected symbols.
As we are already breaking all extensions, take that opportunity
and remove support for the individual entry points: Using a
class with enable()/disable() methods has been the recommended
pattern for a long time, it is now the only entry point.
Instead of instantiating the class from an `init()` function,
the class must now be exported as default to be recognized.
Additionally, we no longer install an importer on the extension
object, so extensions that consist of more than one file MUST
import those files as modules now.
There will be a second breaking change for extensions when
gnome-shell's own code is ported to ESM, so most extension
developers will likely want to wait until the port is complete
before starting to port their extensions.
Florian Müllner [Fri, 9 Jun 2023 18:12:15 +0000 (20:12 +0200)]
animations: Stop syncing size manually
The returned slice actors are now set up to fill their parent,
accounting for any difference between loaded- and displayed size,
so we can stop syncing the size manually.
Florian Müllner [Fri, 9 Jun 2023 17:52:15 +0000 (19:52 +0200)]
st/texture-cache: Set up sliced images to fill parent
When using fractional scaling, the size of the loaded image with
applied scaling may still differ from the displayed size. This
is currently addressed by syncing the size of all slice actors
in the (probably only) caller.
Instead, set the actors to fill their parent automatically.
If langinfo isn't available, we determine the week start via
a "magic" string translation from GTK. We currently look up
the string in GTK3's domain, we should use GTK4's instead.
Florian Müllner [Thu, 22 Jun 2023 16:10:48 +0000 (18:10 +0200)]
tests: Remove interactive tests
The tests rely on the ability to run Clutter as stand-alone app,
which hasn't been possible for quite a while now. Event handling
was broken long before that, plus tests that need a human to run
them and evaluate the result aren't that useful to begin with.
It would be neat to test our CSS rendering by setting up a stage,
capturing it and comparing it to a reference image. But writing
some code that exercises backgrounds, borders etc. is hardly the
obstacle to make that happen, and not worth carrying around dead
code.
Florian Müllner [Wed, 28 Jun 2023 21:36:29 +0000 (23:36 +0200)]
ci: Bump mutter image
Mutter stopped hardcoding a non-default user in the image, and
instead wraps its CI tests to run as user. Pull in that image
to hopefully get over some of the recent CI hickups.
Florian Müllner [Tue, 21 Mar 2023 16:07:19 +0000 (17:07 +0100)]
windowManager: Add shortcut for toggling quick settings
Ever since the various status menus were combined into a single
aggregate menu, the menu has been an important entry point. Alas,
we never got around to adding a shortcut for it, not least because
there never was a good candidate.
We just freed super+s which works as either "system" or
"(quick) settings", so use that.
Florian Müllner [Tue, 21 Mar 2023 17:09:08 +0000 (18:09 +0100)]
windowManager: Reindent shortcuts setup
We require all new code to use the non-legacy style. Updating code
on a case-by-case basis works fairly well most of the time, but
here we have a big uniform block, where any addition with a different
style would stick out badly.
data: Unset default shortcut for 'toggle-overview'
The keybinding is a direct, less commonly used alternative to
stand-alone 'super'. While it can be useful to have a regular
keybinding alternative - although 'super+alt+up' also provides
that to some extent - most users probably don't even know about
it's existence.
It is therefore less justified to take away a valuable shortcut
slot, so stop assigning a default shortcut to free 'super+s' for
other actions.
Users who do use the keybinding can still use Settings to assign
a shortcut.
Florian Müllner [Tue, 30 May 2023 12:41:36 +0000 (14:41 +0200)]
portalHelper: Stop using non-default ARGV vector
If gjs itself defines ARGV, it only holds the arguments that are
passed on to the script, and javascript code should combine the
programName and ARGV (or the newer programArgs) when it needs a
C-style argv array.
Do the same in the portal-helper process instead of passing along
the original C argv, to avoid confusion when accessing the arguments
from javascript.
Florian Müllner [Thu, 25 May 2023 19:23:24 +0000 (21:23 +0200)]
extensions-app: Port to ESM
The extensions app is another part of the code base that is largely
separate from the main code base, and can therefore be ported to
ESM before the big switch.
Florian Müllner [Thu, 25 May 2023 18:31:22 +0000 (20:31 +0200)]
dbusServices: Port to ESM
We want to replace gjs' custom (and now legacy) imports system
with standard EcmaScript modules: JS developers are already
familiar with them, they have better tooling support and using
standard features over non-standard ones is generally the right
thing to do.
Our D-Bus services are separate from the main process, and thus
can be ported separately (except for the few imports that are
shared with the main process' code base).
Sam Hewitt [Mon, 19 Jun 2023 19:52:29 +0000 (17:22 -0230)]
panel: Stylesheet updates and minor improvements for panel buttons
- spin out all the panel button styling into a drawing mixin
- clean up the styles generally
- make special cases for the clock and non-flat buttons
- contrast fixes for non-flat buttons, fixes #6768
- new stop icon for the screen recording/cast indicators
Florian Müllner [Mon, 19 Jun 2023 00:24:47 +0000 (02:24 +0200)]
workspace: Reapply border radius on background changes
The rounded corner effect is applied to the background actor, so
we have to reapply the correct values when the background changes
for the corners to persist.
Florian Müllner [Sat, 27 May 2023 13:00:43 +0000 (15:00 +0200)]
subprojects/shew: Adjust to GTK deprecation
GTK 4.12 deprecates gdk_wayland_toplevel_unexport_handle() in favor
of the new gdk_wayland_toplevel_drop_exported_handle(). We are not
bound by API stability, so we can just expose the additional argument
that the replacement requires instead of tracking the handle
internally.
Florian Müllner [Fri, 9 Jun 2023 13:41:03 +0000 (15:41 +0200)]
parentalControlsManager: Don't log error when disabled
We currently special-case the DISABLED error when initializing
filtering, but not on app filter changes.
While it seems reasonable that Malcontent.Manager wouldn't emit
the signal while disabled, that's not actually true: It is emitted
when any user account information tracked by AccountsServices
changes.
Even if the signal were limited to changes of the ParentalControls
extension, it would still get emitted when app filtering *becomes*
disabled.
So regardless of potential improvements in libmalcontent itself,
we should filter out the DISABLED consistently, both when creating
the initial filter and when updating it.
Андрей Гриценко [Mon, 29 May 2023 14:42:13 +0000 (17:42 +0300)]
magnifier: Fix cursor offset
Commit c449058d447c2588d changed the pointer clone to use a single
actor. However that broke applying the hotspot translation to the
position, so the magnified cursor is now displayed with a shift.
Evan Welsh [Wed, 7 Jun 2023 15:58:08 +0000 (08:58 -0700)]
init: Move Meta main loop into JavaScript after GJS context is initialized
gjs now has an internal mainloop that it can spin to resolve
module imports. That loop uses the thread default context,
so its possible that other sources, namely from mutter, get
dispatched when iterating the context. If that happens before
mutter is properly initialized, this will lead to a crash.
GjsContext needs to iterate its internal mainloop when initializing
to resolve internal modules, to avoid iterating Meta's mainloop and
triggering events before Meta is ready we will initialize the Shell
global and thus the GjsContext (js_context) before Meta.
Once GjsContext is initialized, we can call meta_context_setup().
Once Meta is setup and started, we'll run init.js which uses GJS'
internal promises API to set a "mainloop hook". The mainloop hook
is run immediately after the module returns so GJS will not attempt
to iterate the main loop again before exiting.
Also adjust the 'headlessStart' test to not wait for the
MetaContext::started signal, as that signal has now already
been emitted when the code is executed.
Evan Welsh [Wed, 7 Jun 2023 15:30:29 +0000 (08:30 -0700)]
panel: Refactor quick settings loading for asynchronous imports
When the Shell ports to ESM, our inline imports of the network and
bluetooth indicators will no longer be possible, refactor quick settings
to load indicators asynchronously.
Evan Welsh [Wed, 7 Jun 2023 15:47:50 +0000 (08:47 -0700)]
animation: Don't get size information until spinner has a parent
get_size() in _syncAnimationSize() can't be called until the actor
has a parent, otherwise we'll get an error for calling
st_get_theme_node() prior to the actor being on a stage.
_syncAnimationSize() is called asynchronously via
textureCache.load_sliced_image() and there is currently no guarantee
the actor will actually be "loaded" prior to calling it.
This becomes a more obvious error/issue when refactoring parts of the
Shell loading to also be asynchronous.
The windows we create use a simple pattern as content, as that's
easier to follow than completely empty windows. GTK4 no longer
allows hooking into the drawing of arbitrary widgets, so prepare
for that by using a dedicated subclass instead of a signal handler.
GTK4 no longer has the concept of "app-paintable" to skip the
default background drawing. Prepare for that by setting the
desired background via CSS and draw on top of that.
The signals we use to track whether a window has been mapped and
exposed no longer exist in GTK4. Prepare for that by using a
dedicated subclass instead of signal handlers.
The gtk_main() API is gone in GTK4, so we'll have to either
manage our own loop, or use GApplication. The latter also
handles the D-Bus setup for us, so use that.
Florian Müllner [Sat, 27 May 2023 01:19:39 +0000 (03:19 +0200)]
scripting: Make helper proxy initialization async
We are about to port the helper proxy to GApplication, which means
that it will establish a display connection before exporting its
D-Bus name. That means that the compositor must be able to respond
to a roundtrip request to avoid locking, so don't block on the proxy
becoming available.
Florian Müllner [Wed, 8 Mar 2023 19:25:13 +0000 (20:25 +0100)]
tests: Port to Gtk4
There's another remaining bit of Gtk3 code in a small test program
that changes a window title to a random character sequence every
five seconds. While the value of that test is a bit questionable,
it doesn't hurt either and a port is trivial.
Its only purpose is to provide a test case for the remote app menu,
but that support was removed in gnome-shell years ago. We don't
need a test case for GTK's fallback app menu support, so remove
the whole thing.
Florian Müllner [Fri, 19 May 2023 17:02:08 +0000 (19:02 +0200)]
backgroundApps: Allow activating apps
Now that we track apps instead of instances, we can make the menu
items activatable, because the corresponding action is no longer
app specific (like activating a particular tab): We can simply
activate the app, which hopefully will bring it to the foreground
again.
Florian Müllner [Fri, 19 May 2023 14:36:39 +0000 (16:36 +0200)]
backgroundApps: Track apps instead of instances
The background apps menu currently tracks instances rather than
apps. That matches the behavior of `flatpak ps` and can be useful,
for example when one particular instance runs out of control.
But as we don't include any information that allows to actually
distinguish between instances, multiple instances appear simply
as duplicated app entries.
Given that a menu is too limited for detailed information, stop
representing individual instances, and track apps instead.
Andy Holmes [Thu, 1 Jun 2023 22:54:59 +0000 (15:54 -0700)]
overview: Provide public access for search provider registration
Provide a reasonably public way to register and unregister search
providers, without adding too much API.
`Main.overview.searchController` provides access that may be generally
useful, while `SearchController.addProvider()` and
`SearchController.removeProvider()` provide a simple interface for
extensions.
When introducing the pipeline fallback mechanism, support for defining a
custom pipeline was unintentionally dropped, breaking extensions such as
EasyScreenCast.
Florian Müllner [Wed, 24 May 2023 15:09:55 +0000 (17:09 +0200)]
build: Remove Soup2 support
We started to support Soup3 in GNOME 41, and used it by default
since GNOME 43. This should be enough time for distros to adapt,
so GNOME 45 looks like a good moment to drop the old Soup2 support.
Daniel Drake [Wed, 24 May 2023 08:34:42 +0000 (10:34 +0200)]
ibusManager: Close candidate popup upon engine change
The IBusCandidatePopup can get 'stuck' in an active, visible state if
it is on-screen at the point when the input method is changed to a method
that doesn't use such popup (e.g. regular English).
Force the candidate popup to close when the engine is changed.
It will reappear (via regular lookup table update signal) if/when it is
next required.
The CHECK ornament used in powerprofile and volume control is not very
pleasant looking, specially if system font is changed.
Replace CHECK and DOT unicode ornament with revelant icons in popupMenu.
Using a fixed pixel size can result in the cell being too small for the
contained label. Instead use em to scale with the font size like is done
for the other cells. The chosen size corresponds to 16px with the
default font settings.
Out of the box, the container images only support US English. It
can sometimes be necessary to use a different locale, so add
a convenience flag to enable support for additional locales.
A toolbox created by the script can be used as the base of a pet
container that is manually updated with new dependencies over time
and accumalates additional packages; or it can be used as a deposable
container that is recreated each time the dependencies change.
To make the latter case more convenient, add a --replace option
that deletes an existing toolbox before creating the new one.
Florian Müllner [Fri, 17 Mar 2023 00:07:56 +0000 (01:07 +0100)]
tools/create-toolbox: Add convenience script
The script is a thin wrapper around `toolbox create`, mainly to
avoid the tedious image names. In addition, it allows us to
ensure that the container includes a matching mutter version.
Florian Müllner [Thu, 16 Mar 2023 18:01:45 +0000 (19:01 +0100)]
ci: Produce toolbox images
Toolbox is a convenient option for development, but setting up
the image with all dependencies is annoying at best, in particular
later in the cycle when `dnf builddep` is likely insufficient.
To address that, produce toolbox images for main and stable branches
that are based on the regular CI image, and update them whenever
the image version is updated. This guarantees that all build- and
runtime dependencies are included.
Unsurprisingly, the script that produces the image draws heavily
from freedesktop's ci-templates. The most notable difference
(other than being neither distro-agnostic nor generic) is that
tag names are fixed (toolbox:main, toolbox:43 etc.) to make them
easier to consume.
Instead, whether an image needs rebuilding is based on a custom
label that records the base image that was used.
When no cover art is available, the app icon at least allows
distinguishing between different players, so try falling back
to that before using the generic icon name.
Carlos Garnacho [Mon, 1 May 2023 15:04:46 +0000 (17:04 +0200)]
shell: Use swapped signal connection for MetaWindowActor::destroy
The callback would schedule a clutter_actor_destroy() on the first
argument. Unless told otherwise, this is the same actor that is
already being destroyed, so this is a no-op.
Instead, the intent is to make the clone follow up destruction of
the window actor so that it results in correct removal of this
window from the ShellWindowPreviewLayout. Use a swapped connection
to pass the clone actor as the first argument of the signal callback.
Fixes: 04c781674c ("Move WindowPreviewLayout from JS to C") Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6570
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2756>
Sam Hewitt [Tue, 2 May 2023 13:31:12 +0000 (11:01 -0230)]
style: Adjust the tooltip style; fix inconsistency with screenshot UI
- remove screenshot tooltips using a style different from other tooltips
- tone down how dark they are
- fix missing background adjustment for high contrast